using StructureMap;

namespace Northwind.ViewModel
{
    public class CustomerDetailsViewModelFactory 
        : ICustomerDetailsViewModelFactory
    {
        private readonly IContainer _container;

        public CustomerDetailsViewModelFactory(
            IContainer container)
        {
            _container = container;
        }

        public CustomerDetailsViewModel CreateInstance(
            string customerID)
        {
            return _container
                .With("customerID")
                .EqualTo(customerID)
                .GetInstance<CustomerDetailsViewModel>();
        }
    }
}